// File generated from our OpenAPI spec by Stainless.

package com.metest.api.services.blocking.rest.actuator

import com.google.errorprone.annotations.MustBeClosed
import com.metest.api.core.ClientOptions
import com.metest.api.core.RequestOptions
import com.metest.api.core.http.HttpResponseFor
import com.metest.api.models.rest.actuator.env.EnvListParams
import com.metest.api.models.rest.actuator.env.EnvListResponse
import com.metest.api.models.rest.actuator.env.EnvRetrieveByMatchParams
import com.metest.api.models.rest.actuator.env.EnvRetrieveByMatchResponse
import java.util.function.Consumer

interface EnvService {

    /**
     * Returns a view of this service that provides access to raw HTTP responses for each method.
     */
    fun withRawResponse(): WithRawResponse

    /**
     * Returns a view of this service with the given option modifications applied.
     *
     * The original service is not modified.
     */
    fun withOptions(modifier: Consumer<ClientOptions.Builder>): EnvService

    /** Actuator web endpoint 'env' */
    fun list(): EnvListResponse = list(EnvListParams.none())

    /** @see list */
    fun list(
        params: EnvListParams = EnvListParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): EnvListResponse

    /** @see list */
    fun list(params: EnvListParams = EnvListParams.none()): EnvListResponse =
        list(params, RequestOptions.none())

    /** @see list */
    fun list(requestOptions: RequestOptions): EnvListResponse =
        list(EnvListParams.none(), requestOptions)

    /** Actuator web endpoint 'env-toMatch' */
    fun retrieveByMatch(toMatch: String): EnvRetrieveByMatchResponse =
        retrieveByMatch(toMatch, EnvRetrieveByMatchParams.none())

    /** @see retrieveByMatch */
    fun retrieveByMatch(
        toMatch: String,
        params: EnvRetrieveByMatchParams = EnvRetrieveByMatchParams.none(),
        requestOptions: RequestOptions = RequestOptions.none(),
    ): EnvRetrieveByMatchResponse =
        retrieveByMatch(params.toBuilder().toMatch(toMatch).build(), requestOptions)

    /** @see retrieveByMatch */
    fun retrieveByMatch(
        toMatch: String,
        params: EnvRetrieveByMatchParams = EnvRetrieveByMatchParams.none(),
    ): EnvRetrieveByMatchResponse = retrieveByMatch(toMatch, params, RequestOptions.none())

    /** @see retrieveByMatch */
    fun retrieveByMatch(
        params: EnvRetrieveByMatchParams,
        requestOptions: RequestOptions = RequestOptions.none(),
    ): EnvRetrieveByMatchResponse

    /** @see retrieveByMatch */
    fun retrieveByMatch(params: EnvRetrieveByMatchParams): EnvRetrieveByMatchResponse =
        retrieveByMatch(params, RequestOptions.none())

    /** @see retrieveByMatch */
    fun retrieveByMatch(
        toMatch: String,
        requestOptions: RequestOptions,
    ): EnvRetrieveByMatchResponse =
        retrieveByMatch(toMatch, EnvRetrieveByMatchParams.none(), requestOptions)

    /** A view of [EnvService] that provides access to raw HTTP responses for each method. */
    interface WithRawResponse {

        /**
         * Returns a view of this service with the given option modifications applied.
         *
         * The original service is not modified.
         */
        fun withOptions(modifier: Consumer<ClientOptions.Builder>): EnvService.WithRawResponse

        /**
         * Returns a raw HTTP response for `get /rest/actuator/env`, but is otherwise the same as
         * [EnvService.list].
         */
        @MustBeClosed fun list(): HttpResponseFor<EnvListResponse> = list(EnvListParams.none())

        /** @see list */
        @MustBeClosed
        fun list(
            params: EnvListParams = EnvListParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<EnvListResponse>

        /** @see list */
        @MustBeClosed
        fun list(params: EnvListParams = EnvListParams.none()): HttpResponseFor<EnvListResponse> =
            list(params, RequestOptions.none())

        /** @see list */
        @MustBeClosed
        fun list(requestOptions: RequestOptions): HttpResponseFor<EnvListResponse> =
            list(EnvListParams.none(), requestOptions)

        /**
         * Returns a raw HTTP response for `get /rest/actuator/env/{toMatch}`, but is otherwise the
         * same as [EnvService.retrieveByMatch].
         */
        @MustBeClosed
        fun retrieveByMatch(toMatch: String): HttpResponseFor<EnvRetrieveByMatchResponse> =
            retrieveByMatch(toMatch, EnvRetrieveByMatchParams.none())

        /** @see retrieveByMatch */
        @MustBeClosed
        fun retrieveByMatch(
            toMatch: String,
            params: EnvRetrieveByMatchParams = EnvRetrieveByMatchParams.none(),
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<EnvRetrieveByMatchResponse> =
            retrieveByMatch(params.toBuilder().toMatch(toMatch).build(), requestOptions)

        /** @see retrieveByMatch */
        @MustBeClosed
        fun retrieveByMatch(
            toMatch: String,
            params: EnvRetrieveByMatchParams = EnvRetrieveByMatchParams.none(),
        ): HttpResponseFor<EnvRetrieveByMatchResponse> =
            retrieveByMatch(toMatch, params, RequestOptions.none())

        /** @see retrieveByMatch */
        @MustBeClosed
        fun retrieveByMatch(
            params: EnvRetrieveByMatchParams,
            requestOptions: RequestOptions = RequestOptions.none(),
        ): HttpResponseFor<EnvRetrieveByMatchResponse>

        /** @see retrieveByMatch */
        @MustBeClosed
        fun retrieveByMatch(
            params: EnvRetrieveByMatchParams
        ): HttpResponseFor<EnvRetrieveByMatchResponse> =
            retrieveByMatch(params, RequestOptions.none())

        /** @see retrieveByMatch */
        @MustBeClosed
        fun retrieveByMatch(
            toMatch: String,
            requestOptions: RequestOptions,
        ): HttpResponseFor<EnvRetrieveByMatchResponse> =
            retrieveByMatch(toMatch, EnvRetrieveByMatchParams.none(), requestOptions)
    }
}
